home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / Java / Pdapilot / address / Record.java < prev   
Encoding:
Java Source  |  1997-08-03  |  1.1 KB  |  49 lines

  1.  
  2. package Pdapilot.address;
  3.  
  4. import java.io.*;
  5.  
  6. /** A representation of an address database record.
  7.  */
  8.  
  9. public class Record extends Pdapilot.Record {
  10.  
  11.         public int[] phoneLabel;
  12.         public int showPhone;
  13.         public String[] entry;
  14.         
  15.         public Record() {
  16.             super();
  17.         }
  18.         
  19.         public Record(byte[] contents, Pdapilot.RecordID id, int index, int attr, int cat) {
  20.             super(contents, id, index, attr, cat);
  21.         }
  22.         
  23.         public native void unpack(byte[] data);
  24.         public native byte[] pack();
  25.                 
  26.         public void fill() {
  27.             entry = new String[19];
  28.             phoneLabel = new int[5];
  29.             showPhone = 0;
  30.         }
  31.         
  32.         public String describe() {
  33.             StringBuffer c = new StringBuffer("phoneLabel=[");
  34.             for(int i=0;i<phoneLabel.length;i++) {
  35.                 if (i>0)
  36.                     c.append(",");
  37.                 c.append(phoneLabel[i]);
  38.             }
  39.             c.append("], entry=[");
  40.             for(int i=0;i<entry.length;i++) {
  41.                 if (i>0)
  42.                     c.append(",");
  43.                 c.append((entry[i] == null) ? "(null)" : entry[i]);
  44.             }
  45.             c.append("]");
  46.           return "showPhone="+showPhone+", "+c+", "+super.describe();
  47.         }
  48. }
  49.